/*
 * @Description: 显示图片 modal
 * @Author: kanglin
 * @Date: 2018-05-29 17:32:15
 * @Copyright: Created by Panxsoft.
 */
import { Modal } from 'iview';

export default {
	methods: {
		/**
		 * 显示预览图
		 * @param {string} url
		 */
		showPicture(url, width = 680) {
			const imageStyle = { width: '100%' };
			Modal.confirm({
				width,
				maskClosable: true,
				render: () => (
					<div class="preview">
						<img src={url} style={imageStyle}/>
					</div>
				),
			});
		},
	},
};
